//
//  WHPackageHeaderView.m
//  SquirrelSeller
//
//  Created by 邓伟浩 on 2019/1/12.
//  Copyright © 2019 邓伟浩. All rights reserved.
//

#import "WHPackageHeaderView.h"

@interface WHPackageHeaderView ()

@property (nonatomic, strong) UILabel *coopLabel;
@property (nonatomic, strong) UILabel *transLabel;
@property (nonatomic, strong) UILabel *moneyLabel;
@property (nonatomic, strong) UILabel *dateLabel;

@end

@implementation WHPackageHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setMoneyDetailHeaderUI];
    }
    return self;
}

- (void)setMoneyDetailHeaderUI {
    [self addSubview:({
        _coopLabel = [[UILabel alloc] init];
        _coopLabel.textAlignment = NSTextAlignmentCenter;
        _coopLabel.adjustsFontSizeToFitWidth = YES;
        _coopLabel.textColor = CMDarkOrangeColor;
        _coopLabel.font = SYSTEMFONT(kRealwidth(15));
        _coopLabel.text = @"合作对象";
        _coopLabel.backgroundColor = HexColor(@"ffeee5");
        
        ViewBorderRadius(_coopLabel, 0, 0.5, CLineColor);
        
        _coopLabel;
    })];
    [_coopLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.left.mas_equalTo(self);
        make.width.mas_equalTo(kRealwidth(100));
    }];
    
    [self addSubview:({
        _transLabel = [[UILabel alloc] init];
        _transLabel.textAlignment = NSTextAlignmentCenter;
        _transLabel.adjustsFontSizeToFitWidth = YES;
        _transLabel.textColor = CMDarkOrangeColor;
        _transLabel.font = SYSTEMFONT(kRealwidth(15));
        _transLabel.text = @"运单号";
        _transLabel.backgroundColor = HexColor(@"ffeee5");
        
        ViewBorderRadius(_transLabel, 0, 0.5, CLineColor);
        
        _transLabel;
    })];
    [_transLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(self);
        make.left.mas_equalTo(_coopLabel.mas_right);
        make.width.mas_equalTo(kRealwidth(90));
    }];
    
    [self addSubview:({
        _moneyLabel = [[UILabel alloc] init];
        _moneyLabel.textAlignment = NSTextAlignmentCenter;
        _moneyLabel.adjustsFontSizeToFitWidth = YES;
        _moneyLabel.textColor = CMDarkOrangeColor;
        _moneyLabel.font = SYSTEMFONT(kRealwidth(15));
        _moneyLabel.backgroundColor = HexColor(@"ffeee5");
        _moneyLabel.text = @"金额(元)";
        
        ViewBorderRadius(_moneyLabel, 0, 0.5, CLineColor);
        
        _moneyLabel;
    })];
    [_moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(self);
        make.left.mas_equalTo(_transLabel.mas_right);
        make.width.mas_equalTo(kRealwidth(75));
    }];
    
    [self addSubview:({
        _dateLabel = [[UILabel alloc] init];
        _dateLabel.textAlignment = NSTextAlignmentCenter;
        _dateLabel.adjustsFontSizeToFitWidth = YES;
        _dateLabel.textColor = CMDarkOrangeColor;
        _dateLabel.font = SYSTEMFONT(kRealwidth(15));
        _dateLabel.backgroundColor = HexColor(@"ffeee5");
        _dateLabel.text = @"结算时间";
        
        ViewBorderRadius(_dateLabel, 0, 0.5, CLineColor);
        
        _dateLabel;
    })];
    [_dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(self);
        make.left.mas_equalTo(_moneyLabel.mas_right);
        make.width.mas_equalTo(kRealwidth(110));
    }];
}

@end
